package dparish.client.view;

import java.util.List;

import com.google.gwt.user.client.ui.Widget;

import dparish.client.proxy.CommonEntityProxy;

/**
 * Like EntityView, except for multiple entities
 * @author dparish
 *
 * @param <Entity> The entity class.
 * @see EntityView
 */
public interface EntityListView <Entity extends CommonEntityProxy> extends CommonView{
	
	public interface Presenter <Entity extends CommonEntityProxy> {
		/**
		 * An entity has been selected (like clicking a row on a table.
		 */
		void onSelectedEvent (Entity entity);

		/**
		 * An add event (someone wants to add an enitity)
		 */
		void onAddEvent();
		void setEntities(List<Entity> entities);
		List<Entity> getEntities();
	}
	
	  /**
	   * @see EntityView#setPresenter(dparish.client.view.EntityView.Presenter)
	   */
	  void setPresenter (Presenter<Entity> p);
	  
	  /**
	   * Like EntityView.saveCallback, but for a load of the list.
	   * @see EntityView#saveCallback(String)
	   */
  	  void loadCallback (String message);

}
